Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modify the Endpoint in README.md from '/prediction' to '/predictions'. #13

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

melodyliu1986
Copy link

@melodyliu1986 melodyliu1986 commented Aug 7, 2024

Modify the Endpoint in README.md from '/prediction' to '/predictions'.

Description

I followed the Red Hat OpenShift AI Learning Resource "Deploying a sample Python application using Flask and OpenShift" to deploy my application and try to test the sample Flask application. And found the endpoint in the resource is not correct, it should be "predictions", NOT "prediction". Then I checked the code, and found the README.md has issues.

How Has This Been Tested?

Using "prediction" - 404 error

$ curl -X POST -d'{"hello":"world"}' https://expert-sniffle-git-soliu-dev.apps.sandbox-m2.ll9k.p1.openshiftapps.com/prediction
<!doctype html>
<html lang=en>
<title>404 Not Found</title>
<h1>Not Found</h1>
<p>The requested URL was not found on the server. If you entered the URL manually please check your spelling and try again.</p>

Using "predictions" - work as expected

$ curl -X POST -d'{"hello":"world"}' https://expert-sniffle-git-soliu-dev.apps.sandbox-m2.ll9k.p1.openshiftapps.com/predictions
{"prediction":"not implemented"}

According to the wsgi.py file, it should be "predictions" instead of "prediction":
@application.route('/predictions', methods=['POST'])

Merge criteria:

  • The commits are squashed in a cohesive manner and have meaningful messages.
  • Testing instructions have been added in the PR body (for PRs involving changes that are not immediately obvious).
  • The developer has manually tested the changes and verified that the changes work

melodyliu1986

This comment was marked as off-topic.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants